<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isBeforeDate</title>
</head>

<body>
    <script>
        const isBeforeDate = (dateA, dateB) => {
            if (dateA instanceof Date && dateB instanceof Date) {
                return dateA < dateB;
            }
            return false;
        };
        document.write(`isBeforeDate(new Date(2010, 10, 20), new Date(2010, 10, 21))的结果是:${isBeforeDate(new Date(2010, 10, 20), new Date(2010, 10, 21))}`)
    </script>
</body>

</html>